Customizing Event Processing
Movie controller components provide a number of functions that allow your application to customize event processing. If your application does not use the
MCIsPlayerEvent
function (described on
MCIsPlayerEvent
), you can use these functions to direct movie controller events to the appropriate movie controller component. The component then attempts to handle the event.
Your application obtains the values for many of the function parameters from the appropriate event structure.
Each function returns a value that indicates whether it handled the event. If the controller component completely handles the event, the function sets the return value to 1. If the controller component does not handle the event, the function sets the return value to 0. Your application must then handle the event.
MCActivate
Your application can use the
MCActivate
function in response to activate, deactivate, suspend, and resume events.
pascal ComponentResult MCActivate (MovieController mc,
WindowPtr w,
Boolean activate);
-
mc
-
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's
OpenComponent
or
OpenDefaultComponent
function, or from the
NewMovieController
function (described on
NewMovieController
).
-
w
-
Specifies the window in which the event has occurred.
-
activate
-
Indicates the nature of the event. Set this parameter to
true
for activate and resume events. Set it to
false
for deactivate and suspend events.
DESCRIPTION
The
MCActivate
function returns a value indicating whether it handled the event. The function sets the returned value to 1 if it handles the event. The function sets the returned value to 0 if it does not handle the event. In this case, your application is responsible for the event.
MCClick
Your application should call the
MCClick
function when the user clicks in a movie controller window.
pascal ComponentResult MCClick (MovieController mc, WindowPtr w,
Point where, long when,
long modifiers);
-
mc
-
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's
OpenComponent
or
OpenDefaultComponent
function, or from the
NewMovieController
function (described on
NewMovieController
).
-
w
-
Specifies the window in which the event has occurred.
-
where
-
Indicates the location of the click. This value is expressed in the local coordinates of the window specified by the
w
parameter. Your application must convert this value from the global coordinates returned in the event structure.
-
when
-
Indicates when the user pressed the mouse button. You obtain this value from the event structure.
-
modifiers
-
Specifies modifier flags for the event. You obtain this value from the event structure.
DESCRIPTION
The
MCClick
function returns a value indicating whether it handled the event. The function sets the returned value to 1 if it handles the event. The function sets the returned value to 0 if it does not handle the event. In this case, your application is responsible for the event.
MCDraw
Your application should call the
MCDraw
function in response to an update event. The movie controller component updates the movie controller if the controller is in the window that received the update event. The controller component updates the movie associated with the controller only if the movie is contained in the window that received the event.
pascal ComponentResult MCDraw (MovieController mc, WindowPtr w);
-
mc
-
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's
OpenComponent
or
OpenDefaultComponent
function, or from the
NewMovieController
function (described on
NewMovieController
).
-
w
-
Points to the window in which the update event has occurred.
DESCRIPTION
The
MCDraw
function returns a value indicating whether it handled the event. The function sets the returned value to 1 if it handles the event. The function sets the returned value to 0 if it does not handle the event. In this case, your application is responsible for the event.
MCIdle
The
MCIdle
function performs idle processing for a movie controller. This idle processing includes calling the Movie Toolbox's
MoviesTask
function for each movie that is associated with the controller. Your application should call the
MCIdle
function as often as possible, in order to ensure consistent movie play behavior.
pascal ComponentResult MCIdle (MovieController mc);
-
mc
-
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's
OpenComponent
or
OpenDefaultComponent
function, or from the
NewMovieController
function (described on
NewMovieController
).
DESCRIPTION
The
MCIdle
function returns a value indicating whether it handled the event. The function sets the returned value to 1 if it handles the event. The function sets the returned value to 0 if it does not handle the event. In this case, your application is responsible for the event.
MCKey
The
MCKey
function handles keyboard events for a movie controller. You can call this function only if you have enabled keystroke processing in the controller. By default, keystroke processing is turned off when you create a movie controller. You can enable and disable keystroke processing using the
mcActionSetKeysEnabled
action with the
MCDoAction
function (described on
MCDoAction
).
pascal ComponentResult MCKey (MovieController mc, SInt8 key,
long modifiers);
-
mc
-
Specifies the movie controller for the operation. You obtain this identifier from the Component Manager's
OpenComponent
or
OpenDefaultComponent
function, or from the
NewMovieController
function (described on
NewMovieController
).
-
key
-
Specifies the keystroke. You obtain this value from the event structure.
-
modifiers
-
Specifies modifier flags for the event. You obtain this value from the event structure.
DESCRIPTION
The
MCKey
function returns a value indicating whether it handled the event. The function sets the returned value to 1 if it handles the event. The function sets the returned value to 0 if it does not handle the event. In this case, your application is responsible for the event.
© 1999 Apple Computer, Inc.Previous | Overview | Contents | Next